<template>
  <div class="app">
    <router-view></router-view>
    <nav-bar v-if="showNavBar"></nav-bar>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import NavBar from '@/components/NavBar.vue'

const route = useRoute()
const showNavBar = computed(() => {
  const noNavBarRoutes = ['login', 'register']
  return !noNavBarRoutes.includes(route.name)
})
</script>

<style>
.app {
  min-height: 100vh;
  padding-bottom: 60px; /* 为底部导航栏留出空间 */
}
</style> 